package com.iknow.xmpp.service.aidl;

import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import android.os.RemoteException;
import com.iknow.xmpp.service.Message;

public abstract interface IMessageListener
  implements IInterface
{
  public abstract void processMessage(IChat paramIChat, Message paramMessage)
    throws RemoteException;

  public abstract void stateChanged(IChat paramIChat)
    throws RemoteException;

  public static abstract class Stub extends Binder
  implements IMessageListener
  {
    private static final String DESCRIPTOR = "com.iknow.xmpp.service.aidl.IMessageListener";
    static final int TRANSACTION_processMessage = 1;
    static final int TRANSACTION_stateChanged = 2;

    public Stub()
    {
      attachInterface(this, "com.iknow.xmpp.service.aidl.IMessageListener");
    }

    public static IMessageListener asInterface(IBinder paramIBinder)
    {
      Object localObject;
      if (paramIBinder == null)
        localObject = null;
      while (true)
      {
        while (true)
        {
          return localObject;
          IInterface localIInterface = paramIBinder.queryLocalInterface("com.iknow.xmpp.service.aidl.IMessageListener");
          if ((localIInterface == null) || (!(localIInterface instanceof IMessageListener)))
            break;
          localObject = (IMessageListener)localIInterface;
        }
        localObject = new Proxy(paramIBinder);
      }
    }

    public IBinder asBinder()
    {
      return this;
    }

    public boolean onTransact(int paramInt1, Parcel paramParcel1, Parcel paramParcel2, int paramInt2)
      throws RemoteException
    {
      boolean bool;
      switch (paramInt1)
      {
      default:
        bool = super.onTransact(paramInt1, paramParcel1, paramParcel2, paramInt2);
      case 1598968902:
      case 1:
      case 2:
      }
      while (true)
      {
        Message localMessage;
        while (true)
        {
          return bool;
          paramParcel2.writeString("com.iknow.xmpp.service.aidl.IMessageListener");
          bool = true;
        }
        paramParcel1.enforceInterface("com.iknow.xmpp.service.aidl.IMessageListener");
        IChat localIChat = IChat.Stub.asInterface(paramParcel1.readStrongBinder());
        if (paramParcel1.readInt() != 0)
          localMessage = (Message)Message.CREATOR.createFromParcel(paramParcel1);
        while (true)
        {
          while (true)
          {
            processMessage(localIChat, localMessage);
            paramParcel2.writeNoException();
            bool = true;
          }
          localMessage = null;
        }
        paramParcel1.enforceInterface("com.iknow.xmpp.service.aidl.IMessageListener");
        stateChanged(IChat.Stub.asInterface(paramParcel1.readStrongBinder()));
        paramParcel2.writeNoException();
        bool = true;
      }
    }

    private static class Proxy
  implements IMessageListener
    {
      private IBinder mRemote;

      Proxy(IBinder paramIBinder)
      {
        this.mRemote = paramIBinder;
      }

      public IBinder asBinder()
      {
        return this.mRemote;
      }

      public String getInterfaceDescriptor()
      {
        return "com.iknow.xmpp.service.aidl.IMessageListener";
      }

      public void processMessage(IChat paramIChat, Message paramMessage)
        throws RemoteException
      {
        Parcel localParcel1 = Parcel.obtain();
        Parcel localParcel2 = Parcel.obtain();
        try
        {
          localParcel1.writeInterfaceToken("com.iknow.xmpp.service.aidl.IMessageListener");
          if (paramIChat != null)
          {
            localIBinder = paramIChat.asBinder();
            localParcel1.writeStrongBinder(localIBinder);
            if (paramMessage == null)
              break label84;
            localParcel1.writeInt(1);
            paramMessage.writeToParcel(localParcel1, 0);
            this.mRemote.transact(1, localParcel1, localParcel2, 0);
            localParcel2.readException();
            localParcel2.recycle();
            localParcel1.recycle();
            return;
          }
          label84: IBinder localIBinder = null;
        }
        finally
        {
          localParcel2.recycle();
          localParcel1.recycle();
        }
      }

      // ERROR //
      public void stateChanged(IChat paramIChat)
        throws RemoteException
      {
        // Byte code:
        //   0: invokestatic 34	android/os/Parcel:obtain	()Landroid/os/Parcel;
        //   3: astore_2
        //   4: invokestatic 34	android/os/Parcel:obtain	()Landroid/os/Parcel;
        //   7: astore_3
        //   8: aload_2
        //   9: ldc 24
        //   11: invokevirtual 38	android/os/Parcel:writeInterfaceToken	(Ljava/lang/String;)V
        //   14: aload_1
        //   15: ifnull +44 -> 59
        //   18: aload_1
        //   19: invokeinterface 42 1 0
        //   24: astore 5
        //   26: aload_2
        //   27: aload 5
        //   29: invokevirtual 45	android/os/Parcel:writeStrongBinder	(Landroid/os/IBinder;)V
        //   32: aload_0
        //   33: getfield 18	com/iknow/xmpp/service/aidl/IMessageListener$Stub$Proxy:mRemote	Landroid/os/IBinder;
        //   36: iconst_2
        //   37: aload_2
        //   38: aload_3
        //   39: iconst_0
        //   40: invokeinterface 61 5 0
        //   45: pop
        //   46: aload_3
        //   47: invokevirtual 64	android/os/Parcel:readException	()V
        //   50: aload_3
        //   51: invokevirtual 67	android/os/Parcel:recycle	()V
        //   54: aload_2
        //   55: invokevirtual 67	android/os/Parcel:recycle	()V
        //   58: return
        //   59: aconst_null
        //   60: astore 5
        //   62: goto -36 -> 26
        //   65: astore 4
        //   67: aload_3
        //   68: invokevirtual 67	android/os/Parcel:recycle	()V
        //   71: aload_2
        //   72: invokevirtual 67	android/os/Parcel:recycle	()V
        //   75: aload 4
        //   77: athrow
        //
        // Exception table:
        //   from	to	target	type
        //   8	50	65	finally
      }
    }
  }
}